Skip to content

Conversation

@tzakian
Copy link
Contributor

@tzakian tzakian commented Oct 30, 2024

Adds docs on clever errors.

@tzakian tzakian requested review from damirka and tnowacki October 30, 2024 23:32
> change due to any changes in the source file (e.g., due to auto-formatting, adding a new module
> member, or adding a newline).

## Clever Abort Codes
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a link to a matching page in the book/?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have one in the book/ (at least not yet) so not really anything to reference here unless I'm misunderstanding something.


## Assertions with no Abort Codes

Assertions, and `abort` statements without an abort code will automatically derive an abort code
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Assertions, and `abort` statements without an abort code will automatically derive an abort code
Assertions and `abort` statements without an abort code will automatically derive an abort code


// Print the constant name (if any)
if identifier_index != 0xffff {
let constant_name = get_identifier_at_table_index(module, identifier_index);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_identifier_at_table_index

I appreciate this is pseudo code, but do we have a method for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do, but its name is not quite as descriptive as I would like here (identifier_at). I'll try and make it a bit closer, but I think having a more descriptive name here will be beneficial.

@tzakian tzakian merged commit 0c5fe7e into main Dec 5, 2024
7 checks passed
@damirka damirka deleted the tzakian/clever-errors branch July 15, 2025 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants